package com.alex.ioc.annotation;

import com.alex.ioc.annotation.controller.CarController;
import com.alex.ioc.annotation.dao.impl.CarDaoImpl;
import com.alex.ioc.annotation.service.CarService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Application {

    public static void main(String[] args) {

        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("annotation.xml");

        CarController carController = (CarController) ctx.getBean("carController");
        System.out.println(carController);
        CarService carService = (CarService) ctx.getBean("carService");
        System.out.println(carService);
        CarDaoImpl carDao = (CarDaoImpl) ctx.getBean("carDao");
        System.out.println(carDao);

        carController.execute();
    }
}
